#include<bits/stdc++.h>
using namespace std;
const int N = 20004;

vector<int> edges[N];
int n,m;

int root;
int tot = 1;
int low[N],dfn[N];
bool cut[N];

int ans = 0;

void tarjan(int x)
{
    dfn[x] = low[x] = tot++;
    int child = 0;
    for(auto t:edges[x]){
        if(low[t]==0){
            tarjan(t);
            low[x] = min(low[x],low[t]);
            if(low[t]>=dfn[x]){
                child++;
                if(child>1&&x==root || child>0&&x!=root){
                    if(!cut[x]) ans++;
                    cut[x] = true;
                }
            }
        }
        else{
            low[x] = min(low[x],dfn[t]);
        }
    }
}

int main(){
    scanf("%d%d",&n,&m);
    for(int i=1;i<=m;i++){
        int s,t;
        scanf("%d%d",&s,&t);
        edges[s].emplace_back(t);
        edges[t].emplace_back(s);
    }
    memset(low,0,sizeof(low));
    memset(dfn,0,sizeof(dfn));
    memset(cut,0,sizeof(cut));
    for(int i=1;i<=n;i++){
        if(low[i]==0) {
            root = i;
            tarjan(i);
        }
    }

    printf("%d\n",ans);
    for(int i=1;i<=n;i++){
        if(cut[i]) printf("%d ",i);
    }
    return 0;
}